package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.SEQUENCE;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Goods entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_GOODS", schema = "HCD_DEV", uniqueConstraints = @UniqueConstraint(columnNames = {
		"COMPANY_ID", "BAR_CODE" }))
public class Goods extends Entity implements java.io.Serializable {

	// Fields

	private Long goodsId;
	private Category category;
	private Company company;
	private GoodsClassify goodsClassify;
	private String barCode;
	private String name;
	private String standard;
	private String title;
	private String subTitle;
	private String keywords;
	private String categoryPath;
	private String unit;
	private Float price;
	private Integer stockEnd;
	private Float sellDef;
	private Float sellMin;
	private Float sellExt;
	private String sellUnit;
	private Double unitConvert;
	private String pic;
	private String descrText;
	private String descrDef;
	private Long addTime;
	private Set<StoreGoods> storeGoodses = new HashSet<StoreGoods>(0);
	private Set<GoodsStandard> goodsStandards = new HashSet<GoodsStandard>(0);

	// Constructors

	/** default constructor */
	public Goods() {
	}

	/** minimal constructor */
	public Goods(Category category, Company company, GoodsClassify goodsClassify, String barCode,
			String name, String title, String categoryPath, String unit, Float price,
			Integer stockEnd, Float sellDef, Float sellMin, Float sellExt, Long addTime) {
		this.category = category;
		this.company = company;
		this.goodsClassify = goodsClassify;
		this.barCode = barCode;
		this.name = name;
		this.title = title;
		this.categoryPath = categoryPath;
		this.unit = unit;
		this.price = price;
		this.stockEnd = stockEnd;
		this.sellDef = sellDef;
		this.sellMin = sellMin;
		this.sellExt = sellExt;
		this.addTime = addTime;
	}

	/** full constructor */
	public Goods(Category category, Company company, GoodsClassify goodsClassify, String barCode,
			String name, String standard, String title, String subTitle, String keywords,
			String categoryPath, String unit, Float price, Integer stockEnd, Float sellDef,
			Float sellMin, Float sellExt, String sellUnit, Double unitConvert, String pic,
			String descrText, String descrDef, Long addTime, Set<StoreGoods> storeGoodses,
			Set<GoodsStandard> goodsStandards) {
		this.category = category;
		this.company = company;
		this.goodsClassify = goodsClassify;
		this.barCode = barCode;
		this.name = name;
		this.standard = standard;
		this.title = title;
		this.subTitle = subTitle;
		this.keywords = keywords;
		this.categoryPath = categoryPath;
		this.unit = unit;
		this.price = price;
		this.stockEnd = stockEnd;
		this.sellDef = sellDef;
		this.sellMin = sellMin;
		this.sellExt = sellExt;
		this.sellUnit = sellUnit;
		this.unitConvert = unitConvert;
		this.pic = pic;
		this.descrText = descrText;
		this.descrDef = descrDef;
		this.addTime = addTime;
		this.storeGoodses = storeGoodses;
		this.goodsStandards = goodsStandards;
	}

	// Property accessors
	@SequenceGenerator(name = "generator", sequenceName = "SEQ_GOODS")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "GOODS_ID", unique = true, nullable = false, precision = 15, scale = 0)
	public Long getGoodsId() {
		return this.goodsId;
	}

	public void setGoodsId(Long goodsId) {
		this.goodsId = goodsId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CAT_ID", nullable = false)
	public Category getCategory() {
		return this.category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "COMPANY_ID", nullable = false)
	public Company getCompany() {
		return this.company;
	}

	public void setCompany(Company company) {
		this.company = company;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CLASSIFY_ID", nullable = false)
	public GoodsClassify getGoodsClassify() {
		return this.goodsClassify;
	}

	public void setGoodsClassify(GoodsClassify goodsClassify) {
		this.goodsClassify = goodsClassify;
	}

	@Column(name = "BAR_CODE", nullable = false, length = 20)
	public String getBarCode() {
		return this.barCode;
	}

	public void setBarCode(String barCode) {
		this.barCode = barCode;
	}

	@Column(name = "NAME", nullable = false, length = 250)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "STANDARD", length = 100)
	public String getStandard() {
		return this.standard;
	}

	public void setStandard(String standard) {
		this.standard = standard;
	}

	@Column(name = "TITLE", nullable = false, length = 250)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "SUB_TITLE", length = 250)
	public String getSubTitle() {
		return this.subTitle;
	}

	public void setSubTitle(String subTitle) {
		this.subTitle = subTitle;
	}

	@Column(name = "KEYWORDS", length = 150)
	public String getKeywords() {
		return this.keywords;
	}

	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}

	@Column(name = "CATEGORY_PATH", nullable = false, length = 100)
	public String getCategoryPath() {
		return this.categoryPath;
	}

	public void setCategoryPath(String categoryPath) {
		this.categoryPath = categoryPath;
	}

	@Column(name = "UNIT", nullable = false, length = 30)
	public String getUnit() {
		return this.unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	@Column(name = "PRICE", nullable = false, precision = 8)
	public Float getPrice() {
		return this.price;
	}

	public void setPrice(Float price) {
		this.price = price;
	}

	@Column(name = "STOCK_END", nullable = false, precision = 8, scale = 0)
	public Integer getStockEnd() {
		return this.stockEnd;
	}

	public void setStockEnd(Integer stockEnd) {
		this.stockEnd = stockEnd;
	}

	@Column(name = "SELL_DEF", nullable = false, precision = 8, scale = 1)
	public Float getSellDef() {
		return this.sellDef;
	}

	public void setSellDef(Float sellDef) {
		this.sellDef = sellDef;
	}

	@Column(name = "SELL_MIN", nullable = false, precision = 8, scale = 1)
	public Float getSellMin() {
		return this.sellMin;
	}

	public void setSellMin(Float sellMin) {
		this.sellMin = sellMin;
	}

	@Column(name = "SELL_EXT", nullable = false, precision = 8, scale = 1)
	public Float getSellExt() {
		return this.sellExt;
	}

	public void setSellExt(Float sellExt) {
		this.sellExt = sellExt;
	}

	@Column(name = "SELL_UNIT", length = 30)
	public String getSellUnit() {
		return this.sellUnit;
	}

	public void setSellUnit(String sellUnit) {
		this.sellUnit = sellUnit;
	}

	@Column(name = "UNIT_CONVERT", precision = 8, scale = 1)
	public Double getUnitConvert() {
		return this.unitConvert;
	}

	public void setUnitConvert(Double unitConvert) {
		this.unitConvert = unitConvert;
	}

	@Column(name = "PIC", length = 100)
	public String getPic() {
		return this.pic;
	}

	public void setPic(String pic) {
		this.pic = pic;
	}

	@Column(name = "DESCR_TEXT", length = 2000)
	public String getDescrText() {
		return this.descrText;
	}

	public void setDescrText(String descrText) {
		this.descrText = descrText;
	}

	@Column(name = "DESCR_DEF", length = 4000)
	public String getDescrDef() {
		return this.descrDef;
	}

	public void setDescrDef(String descrDef) {
		this.descrDef = descrDef;
	}

	@Column(name = "ADD_TIME", nullable = false, precision = 15, scale = 0)
	public Long getAddTime() {
		return this.addTime;
	}

	public void setAddTime(Long addTime) {
		this.addTime = addTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "goods")
	public Set<StoreGoods> getStoreGoodses() {
		return this.storeGoodses;
	}

	public void setStoreGoodses(Set<StoreGoods> storeGoodses) {
		this.storeGoodses = storeGoodses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "goods")
	public Set<GoodsStandard> getGoodsStandards() {
		return this.goodsStandards;
	}

	public void setGoodsStandards(Set<GoodsStandard> goodsStandards) {
		this.goodsStandards = goodsStandards;
	}

}